package org.streets.workflow.engine.mem;

import java.util.ArrayList;
import java.util.List;

import org.streets.workflow.engine.IEdge;
import org.streets.workflow.engine.INode;
import org.streets.workflow.engine.event.IEdgeEventListener;


/**
 * 边有两种，一是transition，二是loop。
 */
public abstract class AbstractEdge implements IEdge{
	
    protected INode leavingNode = null;
    protected INode enteringNode = null;
    protected int weight = 0;
    protected final List<IEdgeEventListener> eventListeners = new ArrayList<IEdgeEventListener>();

    public INode getLeavingNode() {
        return leavingNode;
    }

    public void setLeavingNode(INode nodeInst) {
        this.leavingNode = nodeInst;
    }

    public INode getEnteringNode() {
        return enteringNode;
    }

    public void setEnteringNode(INode nodeInst) {
        this.enteringNode = nodeInst;
    }

    public List<IEdgeEventListener> getEventListeners() {
        return eventListeners;
    }
    
    public String toString() {
        return "Edge Instance ["+getEdgeId()+"]";
    }
}
